package com.qianfeng.vhly.youshare.fragments;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.qianfeng.vhly.youshare.MainActivity;
import com.qianfeng.vhly.youshare.R;

/**
 * Created with IntelliJ IDEA.
 * User: vhly[FR]
 * Date: 15/2/4
 * Email: vhly@163.com
 */
public class TutorialJumpFragment extends Fragment implements View.OnClickListener {

    public TutorialJumpFragment() {
        // Default constructor do not delete this method.
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View ret = inflater.inflate(R.layout.fragment_tutorial_jump, container, false);

        View v = ret.findViewById(R.id.tutorial_4_btn);

        if (v != null) {
            v.setOnClickListener(this);
        }

        return ret;
    }

    @Override
    public void onClick(View v) {
        int id = v.getId();
        if (id == R.id.tutorial_4_btn) {
            // TODO 启动主界面，并且关闭自身
            FragmentActivity activity = getActivity();

            activity.startActivity(new Intent(activity, MainActivity.class));

            activity.finish();
        }
    }
}